package com.blb.controller;


import com.blb.entity.Menu;
import com.blb.service.IMenuService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xiaoxiong
 * @since 2020-06-04
 */
@Controller
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private IMenuService iMenuService;
    @RequiresPermissions("menu")
    @ResponseBody
    @RequestMapping("/getmenu")
    public List<Menu> getMenus(Model model){
        List<Menu> menus = iMenuService.getTreeMenu("0");
        //model.addAttribute("menus",menus);
        System.out.println(menus);
        return  menus ;
    }
}

